package m2.connecteur;

import java.util.HashMap;

import m2.Element;
import m2.role.RoleFourni;
import m2.role.RoleRequis;

public class Glue extends Element {

	protected HashMap<String, RoleFourni> roleRAssociatedRoleF;
	protected HashMap<String, RoleRequis> roleFassociatedRoleR;

	public Glue(String name) {
		super(name);
		roleFassociatedRoleR = new HashMap<String, RoleRequis>();
		roleRAssociatedRoleF = new HashMap<String ,RoleFourni >();
	}
	public HashMap<String, RoleFourni> getRoleRAssociatedRoleF() {
		return roleRAssociatedRoleF;
	}

	public void setRoleRAssociatedRoleF(
			HashMap<String, RoleFourni> roleRAssociatedRoleF) {
		this.roleRAssociatedRoleF = roleRAssociatedRoleF;
	}

	public HashMap<String, RoleRequis> getRoleFassociatedRoleR() {
		return roleFassociatedRoleR;
	}

	public void setRoleFassociatedRoleR(
			HashMap<String, RoleRequis> roleFassociatedRoleR) {
		this.roleFassociatedRoleR = roleFassociatedRoleR;
	}



	public RoleRequis getRoleAssociatedRF(String roleFournis) {
		return roleFassociatedRoleR.get(roleFournis);

	}

	public RoleFourni getRoleAssociatedRR(String roleRequis) {
		return roleRAssociatedRoleF.get(roleRequis);

	}
	
	public void associate(RoleRequis rr, RoleFourni rf ){
		roleFassociatedRoleR.put(rf.getName(), rr);
		roleRAssociatedRoleF.put(rr.getName(), rf);
	}

	@Override
	public void update(Object o, Object arg) {
		// TODO Auto-generated method stub
		
	}
	
	Object f(Object o){
		return o;
	}

}
